import request from "@/util/http";


// 获取宠物列表
export const getPets = (category = '全部', page = 1, name = '') => {
    return request({
        url: "admin/pets",
        method: "get",
        headers: {
            'Content-Type': 'application/json'
        },
        params: {
            category,
            page,
            name
        }
    });
};

// 获取宠物分类
export const getPetCategories = () => {
    return request({
        url: "admin/pet_categories",
        method: "get",
        headers: {
            'Content-Type': 'application/json'
        }
    });
};

// 添加宠物
export const addPet = (data) => {
    return request({
        url: "admin/pets",
        method: "post",
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
};

// 更新宠物信息
export const updatePet = (pet_id, data) => {
    return request({
        url: `admin/pets/${pet_id}`,
        method: "put",
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
};
// 删除宠物
export const deletePet = (pet_id) => {
    return request({
        url: `admin/pets/${pet_id}`,
        method: "delete",
        headers: {
            'Content-Type': 'application/json'
        }
    });
};